package com.guigu.qingcheng.servicegoods.config;

import com.guigu.qingcheng.servicegoods.service.TbStockBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 与库存相关任务的定时器
 */

@Component
public class SkuTask {

    @Autowired
    private TbStockBackService stockBackService;

    @Scheduled(cron = "0 0/60 * * * ?")
    public void orderTimeOutLogic() {
        System.out.println("执行库存回滚");
        stockBackService.doBack();
    }
}
